package development.bean;

public class PhomInfo {
  private int[] cards = new int[] {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1};
  private int avaiIndex = 0;
  private int index;
  
  public int size() {
    return avaiIndex;
  }
  
  public void resetIndex() {
    index = 0; 
  }
  
  public int getCard(int index) {
    if (index < avaiIndex) {
      return cards[index];
    }
    return -1;
  }
  
  public int nextCard() {
    index++;
    if (index < avaiIndex) {
      return cards[index - 1];
    } else {
      index = 0;
      return -1;
    }
  }
  
  public void addCard(int card) {
    if (avaiIndex < cards.length) {
      cards[avaiIndex] = card;
      avaiIndex++;
    }
  }
  
  public String toString() {
    String str = "Phom: ";
    for (int i = 0; i < size(); i++) {
      str += getCard(i) + " ";
    }
    return str;
  }
}
